package cn.anquing.util;

import javax.sound.midi.Soundbank;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.stream.Collectors;

/**
 * <pre>
 *
 * @description
 * @author wangqq
 * @email wangqq65@gdii-yueyun.com
 * @since 2023/8/1 10:22
 * @copyright 广东美云智数科技有限公司
 * </pre>
 */
public class UtilTest {
    public UtilTest(String name) {
        this.name = name;
    }

    public UtilTest() {
    }

    public static void main(String[] args) {
        //  这是运算误差问题，运算使用BigDecimal，再用compareTo比较
//        float a = 1.0F - 0.9F;
//        float b = 0.9F - 0.8F;
//        float a = 0.9F;
//        float b = 0.9F;
//        System.out.println(
//                a==b
//        );

        UtilTest utilTest = new UtilTest();
        ArrayList<UtilTest> utilTests = new ArrayList<>();
        for (int i = 0; i < 10;i++){
            utilTest.setName(String.valueOf(i));
            utilTests.add(utilTest);
        }

        System.out.println(
                utilTests.stream().map(UtilTest::getName).collect(Collectors.joining(","))
        );



        ExecutorService executorService = Executors.newCachedThreadPool();

    }

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
